package com.example.listener;

import com.example.destination.JmsAnnoation;
import com.example.destination.JmsListener;
import com.example.message.JmsMessageWrapper;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;

@Service
@JmsAnnoation(destination = "client01.queue", isQueue = true)
public class Client01JmsListener implements JmsListener {

    Logger logger = org.slf4j.LoggerFactory.getLogger(Client01JmsListener.class);

    /****
     * 测试生产者推送消息到队列中，消费者监听队列中的消息
     * @param jmsMessageWrapper
     */
    @Override
    public void onMessage(JmsMessageWrapper jmsMessageWrapper) throws Exception {
        logger.warn("Client01JmsListener received message: " + jmsMessageWrapper.getMessage());
    }
}
